//Main.cpp
#include <stdio.h>

#ifndef __SHAPE_H
#include "Shape.h"
#endif

int main() {
    Figure *f = createFigure();
    for (;;) {
        showMenu();
        char c = getCommand();
        switch (c) {
            case 'L':
            {
                Point p1 = getPoint("p1");
                Point p2 = getPoint("p2");
                Line *l = createLine(p1, p2);
                addShape(f, (ShapeBase*) l);
                break;
            }
            case 'C':
            {
                Point center = getPoint("center");
                int radius = getInt("radius");
                Circle *c = createCircle(center, radius);
                addShape(f, (ShapeBase *) c);
                break;
            }
            case 'R':
            {
                Point p1 = getPoint("width:p1");
                Point p2 = getPoint("width:p2");
                Point p3 = getPoint("heigth:p1");
                Point p4 = getPoint("heigth:p2");
                Line *linha1 = createLine(p1, p2);
                Line *linha2 = createLine(p3, p4);
                Rect *r = createRect(*linha1, *linha2);
                addShape(f, (ShapeBase*) r);
                break;
            }
            case 'D':
            {
                drawFigure(f);
                break;
            }
            case 'M':
            {
                Point p = getPoint("Ponto de incremento: p");
                translateFigure(f, p);
                break;
            }
            case 'X':
                destroyFigure(f);
                return 0;

        } // fim switch

    } // fim for(;;)
} // fim main
